<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition>
		<p:dataTable var="po" value="#{lazyModel}"
			paginator="true" rows="10"
			paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
			rowsPerPageTemplate="5,10,15"  selectionMode="single"
			selection="#{dtPurchaseOrderLazyView.selectedItem}" lazy="true">
			
			<p:ajax event="rowSelect"
				listener="#{dtPurchaseOrderLazyView.onRowSelect}"
				update="#{ajaxRowSelectUpdate}" oncomplete="#{ajaxRowSelectOnComplete}" />
				
			<p:column headerText="ID">
				<h:outputText value="#{po.id}" />
			</p:column>
			<p:column headerText="Order Date">
				<h:outputText value="#{po.orderDate}">
					<f:convertDateTime type="date" pattern="MM/dd/yyyy"/>
				</h:outputText>
			</p:column>
			<p:column headerText="PR#">
				<h:outputText value="#{po.purchaseRequisition.id}" />
			</p:column>
			<p:column headerText="Supplier">
				<h:outputText value="#{po.supplier.name}" />
			</p:column>
			<p:column headerText="Warehouse">
				<h:outputText value="#{po.warehouse.name}" />
			</p:column>
			<p:column headerText="Terms">
				<h:outputText value="#{po.terms}" />
			</p:column>
			<p:column headerText="Due Date" rendered="#{empty showDueDate or showDueDate}">
				<h:outputText value="#{po.dueDate}">
					<f:convertDateTime type="date" pattern="MM/dd/yyyy"/>
				</h:outputText>
			</p:column>
			<p:column headerText="Status" rendered="#{empty showStatus or showStatus}">
				<h:outputText value="#{po.status}" />
			</p:column>
		</p:dataTable>
	</ui:composition>
</body>
</html>